$(function () {
    /*轮播图*/
    $(".swiper-container").swiper({
        loop: true,
        speed:300,
        autoplay : 5000,
        autoplayDisableOnInteraction : false,
        // 如果需要分页器
        // pagination: '.swiper-pagination'

    });
    $(".js-start-collection").on('click',function () {
        let $icon=$(this).children(".iconfont");
       if($icon.hasClass("icon-wujiaoxing-copy")){
           $icon.removeClass("icon-wujiaoxing-copy")
               .addClass("icon-wujiaoxing-copy1");
       }else{
           $icon.removeClass("icon-wujiaoxing-copy1")
               .addClass("icon-wujiaoxing-copy");
       }
    });
    /*评分星级组件*/
    $(".m-grade_star_num").each(function () {
        var score = $(this).parents('.m-grade-stars').find('.m-grade_star_score').html();
        var bg_wh=$(this).parent('.m-grade_star_bg').width();
        var newwidth = (score / 5) * bg_wh;
        console.log(newwidth);
        $(this).css('width', newwidth);
    });
});